{% extends "WebMainSiteBundle:Course:layout.html.twig" %}
{% set title = "课程练习" %}
{% block title %}
    {{ title }}
{% endblock %}

{% block user_main %}

    <section class="comments">
        {#{{ dump(exam) }}#}
        <h2 class="yahei">已有练习</h2>
        <hr/>
        <ul class="media-list">
            <li class="media">
                <div class="media-body">
                {% for row in exam.selectedData %}
                    {#{{ dump(row) }}#}
                    <div class="media">
                        <div class="media-body">
                                <strong>[{{ row.type == 1 ? "考试" : "练习" }}]{{ row.title }}</strong>
                                {#<a href="{{ path("WebCourseLessonArrangeAdd",{uniqueId:course.uniqueId}) }}?id={{ row.id }}" class="pull-right btn btn-green" style="margin-right: 5px;"><i class="fa fa-cogs"></i> 编辑</a>#}
                                <a href="{{ path("WebCourseAddExam",{uniqueId:course.uniqueId,type:type}) }}&examId={{ row.id }}&action=remove" class="pull-right btn btn-danger" style="margin-right: 5px;"><i class="fa fa-reply"></i>移除</a>
                        </div>
                    </div>
                    <hr/>
                {% endfor %}
                </div>
            </li>
        </ul>
        <hr class="invisible" />
        <h2 class="yahei">待选练习</h2>
        <hr/>
        <ul class="media-list">
            <li class="media">
                <div class="media-body">
                {% for row in exam.notSelectedData %}
                    {#{{ dump(row) }}#}
                    <div class="media">
                        <div class="media-body">
                                <strong>[{{ row.type == 1 ? "考试" : "练习" }}]{{ row.title }}</strong>
                                {#<a href="{{ path("WebCourseLessonArrangeAdd",{uniqueId:course.uniqueId}) }}?id={{ row.id }}" class="pull-right btn btn-green" style="margin-right: 5px;"><i class="fa fa-cogs"></i> 编辑</a>#}
                                <a href="{{ path("WebCourseAddExam",{uniqueId:course.uniqueId,type:type}) }}&examId={{ row.id }}&action=add" class="pull-right btn btn-green" style="margin-right: 5px;"><i class="fa fa-plus"></i> 加课程</a>
                        </div>
                    </div>
                    <hr/>
                {% endfor %}
                </div>
            </li>
        </ul>
        <hr class="invisible" />
    </section>

{% endblock %}